package com.varton.theory;

import com.varton.service.OrderSerivce;
import com.varton.service.OrderServiceImpl;

/**
 * jdk动态代理原理
 * @author lihuazeng
 */
public class App {
    public static void main(String[] args) {
        OrderSerivce orderService = new OrderServiceImpl();
        OrderSerivce p = (OrderSerivce) Proxy.newInstance(new MyClassLoader(), orderService.getClass().getInterfaces(),
                new TookInvocationHandler(orderService));
        p.queryOrders();
    }
}